package cn.tedu.micro.order.controller;

import cn.tedu.micro.common.pojo.dto.OrderCreateParam;
import cn.tedu.micro.common.pojo.protocol.JsonResult;
import cn.tedu.micro.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    @PostMapping("create")
    public JsonResult<String> createOrder(OrderCreateParam param){
        String billId = orderService.createOrder(param);
        return JsonResult.ok("创建订单成功！", billId);
    }
}
